/**
 * 121. 买卖股票的最佳时机
 * https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/
 */
public class Solutions_121 {
    public static void main(String[] args) {
        int[] prices = {7, 1, 5, 3, 6, 4};  // output: 6 - 1 = 5
//        int[] prices = {7, 6, 4, 3, 1};  // output: 0

        int result = maxProfit(prices);
        System.out.println(result);
    }

    public static int maxProfit(int[] prices) {
        return Solutions_Offer_63.maxProfit(prices);
    }
}
